package com.lightboat.common.enums;

/**
 * 余额操作状态枚举
 */
public enum OperationTypeEnum {

    ADD("add", "累加"),
    REDUCE("reduce", "递减"),
    REDUCE_UNRESTRICTED("reduceUnrestricted", "递减无限制"),
    LOCK("lock", "锁定"),
    LOWEST_LOCK("lowestLock", "最低锁定"),
    REDUCE_LOCK("reduceLock", "递减锁定"),
    LOCK_ROLLBACK("lockRollback", "锁定回滚");

    private final String value;
    private final String description;

    OperationTypeEnum(String value, String description) {
        this.value = value;
        this.description = description;
    }

    public static OperationTypeEnum getValueOf(String value) {
        for (OperationTypeEnum status : values()) {
            if (status.getValue().equals(value)) {
                return status;
            }
        }
        return null;
    }

    public String getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }
}